const api = require('../../utils/request')
const app = getApp()
import Dialog from '../../miniprogram_npm/@vant/weapp/dialog/dialog';
const moment = require('../../utils/moment')
moment.locale('zh-cn');

Page({
  data: {
    list: [],
    slides: [
      "../../static/1.jpg",
      "../../static/2.jpg",
    ]
  },


  onLoad() {

  },

  onShow() {
    if (!wx.getStorageSync('id')) {//判断是否登录
      wx.reLaunch({
        url: '/pages/login/index'
      })
      return
    }
    this.getData()

  },

  getData() {
    api._post('doctor/getlist', {
      limit: 999,
      offset: 1
    }).then(res => {
      this.setData({
        list: res.data.list//后台获取的医生信息放进list里
      })
    })
  },


  //跳转
  jump(e) {
    let url = e.currentTarget.dataset.url
    wx.navigateTo({
      url: url
    })
  }
})